package com.gem.day06.extend1;

import java.time.LocalDate;

/**固定工资员工*/
public class SalariedEmployee extends Employee {

	private double sal;//固定工资

	public SalariedEmployee() {

	}

	public SalariedEmployee(String name, LocalDate birthday, double sal) {
		super(name, birthday);
		this.sal = sal;
	}

	public double getSal() {
		return sal;
	}

	public void setSal(double sal) {
		this.sal = sal;
	}

	/*
	 * 方法重写
	 * 前提条件:	在不同的类中,并且这两个类存在父子关系
	 * 其他条件: 返回类型,方法名,参数列表完全一致,修饰符必须>=父类方法,抛出的异常必须<=父类
	 */
	@Override
	public double getSalary(int month) {
		return sal + super.getSalary(month);
	}

	@Override
	public String toString() {
		return super.toString() + ",固定工资: " + sal;
	}
}
